<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>prompt</title>
</head>
<body>
        <script>
            var b = prompt('请输入一个数');
            console.log(Math.pow(b,2));  //返回x的y次幂：等于b的二次方
        </script>
</body>
</html>